<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
    
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>

    <head>
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
        <title>输入提示</title>
        <link rel="stylesheet" href="<c:url value="/static/wx/css/style.css"/>" />
        <script type="text/javascript" src="<c:url value="/static/wx/js/lib/rem.js"/>"></script>

        <script type="text/javascript" src="https://webapi.amap.com/maps?v=1.4.10&key=30ab112c81c0a478bf33c58ae1461447&&plugin=AMap.Autocomplete,AMap.PlaceSearch"></script>
        <script type="text/javascript" src="https://cache.amap.com/lbs/static/addToolbar.js"></script>
    </head>

    <body class="bf">
        <div id="wrap">
            <div id="container" class="none"></div>
            <div id="myPageTop">
                <table class="common mt10">
                    <tr>
                        <td>
	                        <label class="c333 f14">苏州市：</label>
	                        <input class="c333 f14" id="tipinput" placeholder="输入街道、写字楼、商圈或小区名称" />
                        </td>
                    </tr>
                </table>
            </div>
        </div>
        <input type="hidden" id="userId" value="${userId }"/>
        <script type="text/javascript" src="<c:url value="/static/wx/js/lib/jquery-3.3.1.min.js"/>"></script>
        <script type="text/javascript">
              //地图加载
                var map = new AMap.Map("container", {
                    resizeEnable: true
                });
                //输入提示
                var autoOptions = {
                    input: "tipinput"
                };
                var auto = new AMap.Autocomplete(autoOptions);
                var placeSearch = new AMap.PlaceSearch({
                    map: map
                });  //构造地点查询类
                AMap.event.addListener(auto, "select", select);//注册监听，当选中某条记录时会触发
                 
                var addressThreee , detailAddress,userId;
                function select(e) {
                    placeSearch.setCity(e.poi.adcode);
                    placeSearch.search(e.poi.name); //关键字查询查询
                    addressThreee = e.poi.district;
                    detailAddress = e.poi.address + e.poi.name;
                    
                    var userId = $("#userId").val();
                    window.location.href="<c:url value="/wx/toAccountSetting.do"/>?id="+userId+"&addressThreee=" + addressThreee + "&detailAddress=" +  detailAddress+"&status=1";
                }
        </script>
    </body>

</html>
